import { createRouter, createWebHistory } from 'vue-router'
import StuNotificationPage from '@/views/student/notification/StuNotificationPage.vue'
import StuTestPage from '@/views/student/test/StuTestPage.vue'
import StuTopicPage from '@/views/student/topic/StuTopicPage.vue'
import StuLayoutPage from '@/views/student/StuLayoutPage.vue'
import StuTestContentPage from '@/views/student/test/StuTestContentPage.vue'
import StuTopicContentPage from '@/views/student/topic/StuTopicContentPage.vue'
import StuTopicCreatePage from '@/views/student/topic/StuTopicCreatePage.vue'
import StuLoginPage from '@/views/LoginPage.vue'
import TeaLayoutPage from '@/views/teacher/TeaLayoutPage.vue'
import TeaNotificationPage from '@/views/teacher/notification/TeaNotificationPage.vue'
import TeaNotificationCreatePage from '@/views/teacher/notification/TeaNotificationCreatePage.vue'
import TeaTopicPage from '@/views/teacher/topic/TeaTopicPage.vue'
import TeaTopicCreatePage from '@/views/teacher/topic/TeaTopicCreatePage.vue'
import TeaTopicContentPage from '@/views/teacher/topic/TeaTopicContentPage.vue'
import TeaResourceVideoPage from '@/views/teacher/video/TeaResourceVideoPage.vue'
import TeaResourceDocumentPage from '@/views/teacher/document/TeaResourceDocumentPage.vue'
import TeaResourceCoursewarePage from '@/views/teacher/courseware/TeaResourceCoursewarePage.vue'
import TeaResourceVideoCreatePage from '@/views/teacher/video/TeaResourceVideoCreatePage.vue'
import TeaResourceVideoPlayPage from '@/views/teacher/video/TeaResourceVideoPlayPage.vue'
import TeaResourceDocumentCreatePage from '@/views/teacher/document/TeaResourceDocumentCreatePage.vue'
import TeaResourceDocumentViewPage from '@/views/teacher/document/TeaResourceDocumentViewPage.vue'
import TeaResourceCoursewareCreatePage from '@/views/teacher/courseware/TeaResourceCoursewareCreatePage.vue'
import TeaResourceCoursewareViewPage from '@/views/teacher/courseware/TeaResourceCoursewareViewPage.vue'
import StuResourceVideoPage from '@/views/student/video/StuResourceVideoPage.vue'
import StuResourceDocumentPage from '@/views/student/document/StuResourceDocumentPage.vue'
import StuResourceCoursewarePage from '@/views/student/courseware/StuResourceCoursewarePage.vue'
import StuResourceVideoPlayPage from '@/views/student/video/StuResourceVideoPlayPage.vue'
import StuResourceDocumentViewPage from '@/views/student/document/StuResourceDocumentViewPage.vue'
import StuResourceCoursewareViewPage from '@/views/student/courseware/StuResourceCoursewareViewPage.vue'
import TeaTestPage from '@/views/teacher/test/TeaTestPage.vue'
import TeaTestPaperLibraryPage from '@/views/teacher/test/TeaTestPaperLibraryPage.vue'
import TeaTestCreatePage from '@/views/teacher/test/TeaTestCreatePage.vue'
import StuTestResultPage from '@/views/student/test/StuTestResultPage.vue'
import TeaTestStatisticsPage from '@/views/teacher/test/TeaTestStatisticsPage.vue'
import TeaTestStatisticsDetailPage from '@/views/teacher/test/TeaTestStatisticsDetailPage.vue'
import TeaManagement from '@/views/teacher/management/TeaManagementPage.vue'
import StuRegister from '@/views/student/StuRegister.vue'
import TeaRegister from '@/views/teacher/TeaRegister.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      component: StuLoginPage
    },
    {
      path: '/student/register',
      component: StuRegister
    },
    {
      path: '/teacher/register',
      component: TeaRegister
    },
    {
      path: '/student',
      redirect: '/student/notification',
      component: StuLayoutPage,
      children: [
        {
          path: '/student/notification',
          component: StuNotificationPage
        },
        {
          path: '/student/test',
          component: StuTestPage
        },
        {
          path: '/student/topic',
          component: StuTopicPage
        },
        {
          path: '/student/topic/:id',
          component: StuTopicContentPage
        },
        {
          path: '/student/topic/add',
          component: StuTopicCreatePage
        },
        {
          path: '/student/resource/video',
          component: StuResourceVideoPage
        },
        {
          path: '/student/resource/video/:id',
          component: StuResourceVideoPlayPage
        },
        {
          path: '/student/resource/document',
          component: StuResourceDocumentPage
        },
        {
          path: '/student/resource/document/:id',
          component: StuResourceDocumentViewPage
        },
        {
          path: '/student/resource/courseware',
          component: StuResourceCoursewarePage
        },
        {
          path: '/student/resource/courseware/:id',
          component: StuResourceCoursewareViewPage
        },
        {
          path: '/student/test/result/:id',
          component: StuTestResultPage
        }
      ]
    },
    {
      path: '/student/test/:id',
      component: StuTestContentPage
    },

    {
      path: '/teacher',
      redirect: '/teacher/notification',
      component: TeaLayoutPage,
      children: [
        {
          path: '/teacher/notification',
          component: TeaNotificationPage
        },
        {
          path: '/teacher/notification/add',
          component: TeaNotificationCreatePage
        },
        {
          path: '/teacher/topic',
          component: TeaTopicPage
        },
        {
          path: '/teacher/topic/:id',
          component: TeaTopicContentPage
        },
        {
          path: '/teacher/topic/add',
          component: TeaTopicCreatePage
        },
        {
          path: '/teacher/resource/video',
          component: TeaResourceVideoPage
        },
        {
          path: '/teacher/resource/document',
          component: TeaResourceDocumentPage
        },
        {
          path: '/teacher/resource/courseware',
          component: TeaResourceCoursewarePage
        },
        {
          path: '/teacher/resource/video/add',
          component: TeaResourceVideoCreatePage
        },
        {
          path: '/teacher/resource/video/:id',
          component: TeaResourceVideoPlayPage
        },
        {
          path: '/teacher/resource/document/add',
          component: TeaResourceDocumentCreatePage
        },
        {
          path: '/teacher/resource/document/:id',
          component: TeaResourceDocumentViewPage
        },
        {
          path: '/teacher/resource/courseware/add',
          component: TeaResourceCoursewareCreatePage
        },
        {
          path: '/teacher/resource/courseware/:id',
          component: TeaResourceCoursewareViewPage
        },
        {
          path: '/teacher/test',
          component: TeaTestPage
        },
        {
          path: '/teacher/test/paperLibrary',
          component: TeaTestPaperLibraryPage
        },
        {
          path: '/teacher/test/create/:id',
          component: TeaTestCreatePage
        },
        {
          path: '/teacher/test/statistics',
          component: TeaTestStatisticsPage
        },
        {
          path: '/teacher/test/statistics/:id',
          component: TeaTestStatisticsDetailPage
        },
        {
          path: '/teacher/management',
          component: TeaManagement
        }
      ]
    }
  ]
})

export default router
